{include file='common/doc'}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <table id="table_list" lay-filter="table_list"></table>
            <script type="text/html" id="op_table">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
                        class="layui-icon layui-icon-edit"></i>编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
                        class="layui-icon layui-icon-delete"></i>删除</a>
            </script>
            <template id="table_toolbar">
                <div class="layui-btn-group">
                    <button type="button" lay-event="add" class="layui-btn layui-btn-primary layui-btn-sm">
                        <i class="layui-icon layui-icon-add-1"></i>
                    </button>
                    <button type="button" lay-event="search_sh" class="layui-btn layui-btn-primary layui-btn-sm">
                        <i class="layui-icon layui-icon-search "></i>
                    </button>
                </div>
            </template>
        </div>
    </div>
</div>
<template id="form_template" style="display: none">
    <form class="layui-form"  id="form" lay-filter="form" action="" style="margin-top:10px;">
        <div class="layui-form-item">
            <label class="layui-form-label">广告名称</label>
            <div class="layui-input-inline">
                <input type="text" name="advertising_name" required lay-verify="required" lay-reqText="昵称不能为空"
                       lay-verType="tips"
                       placeholder="请输入昵称"
                       autocomplete="off" class="layui-input">
            </div>
            <!--     <div class="layui-form-mid layui-word-aux">辅助字段</div>-->
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">栏目</label>
            <div class="layui-input-inline">
                <input type="text" id="tree" lay-filter="tree" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">显示位置</label>
            <div class="layui-input-inline">
                <select name="show_location" id="">
                    <option value=""></option>
                    <option value="1">页面</option>
                    <option value="2">banner</option>
                    <option value="3">浮动</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">动画类型</label>
            <div class="layui-input-inline">
                <select name="animation" >
                    <option value="0">无</option>
                    <option value="1">微微往上滑入</option>
                    <option value="2">从最底部往上滑入</option>
                    <option value="3">平滑放大</option>
                    <option value="4">弹簧式放大</option>
                    <option value="5">渐现</option>
                    <option value="6">渐隐</option>
                    <option value="7">360度旋转</option>
                    <option value="8">循环动画</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">链接</label>
            <div class="layui-input-inline">
                <input type="text" name="advertising_link" required lay-verify="required" lay-reqText="昵称不能为空"
                       lay-verType="tips"
                       placeholder="链接地址"
                       autocomplete="off" class="layui-input">
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <div class="layui-input-block">
                <div class="layui-upload-drag" id="img" >
                    <i class="layui-icon"></i>
                    <p>选择文件</p>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="hidden" name="column_id">
                <input type="hidden" name="advertising_img" class="layui-input">
                <input type="checkbox" name="status" value="1" lay-skin="switch" lay-text="开启|关闭">
            </div>
            <!--     <div class="layui-form-mid layui-word-aux">辅助字段</div>-->
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block layui-textarea">
                <textarea name="desc" id="desc" cols="30" rows="10"></textarea>
            </div>
            <!--     <div class="layui-form-mid layui-word-aux">辅助字段</div>-->
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="form_submit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</template>
<script type="text/html" id="status">
    {{#  if(d.status == 1){ }}
    <button class="layui-btn layui-btn-xs">启用</button>
    {{#  } else { }}
    <button class="layui-btn layui-btn-primary layui-btn-xs">禁用</button>
    {{#  } }}
</script>
<script src="/layuiadmin/layui/layui.js"></script>
</body>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index' ,'table','treeSelect','upload'] ,function () {
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table
        var layedit = layui.layedit;

        table.render({
            elem: '#table_list'
            ,height: 'full-50'
            ,toolbar: '#table_toolbar'
            ,url: 'read' //数据接口
            ,page: true //开启分页
            ,limit:20
            ,cols: [
                [ //表头
                    {type: 'checkbox'} ,
                    {type: 'numbers' }
                    ,{field: '' ,align: "center" ,title: ''}
                    ,{title: '操作' ,width: 150 ,align: 'center' ,fixed: 'right' ,toolbar: '#op_table'}
                ]
            ]
        });

    });
</script>
</html>

